package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TeacherTitle generated by hbm2java
 */
@Entity
@Table(name = "teacher_title")
public class TeacherTitle implements java.io.Serializable {

	private TeacherTitleId id;
	private TechnicalTitle technicalTitle;
	private Teacher teacher;
	private Date date;

	public TeacherTitle() {
	}

	public TeacherTitle(TeacherTitleId id, TechnicalTitle technicalTitle,
			Teacher teacher) {
		this.id = id;
		this.technicalTitle = technicalTitle;
		this.teacher = teacher;
	}

	public TeacherTitle(TeacherTitleId id, TechnicalTitle technicalTitle,
			Teacher teacher, Date date) {
		this.id = id;
		this.technicalTitle = technicalTitle;
		this.teacher = teacher;
		this.date = date;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "teacherId", column = @Column(name = "TEACHER_ID", nullable = false)),
			@AttributeOverride(name = "titleId", column = @Column(name = "TITLE_ID", nullable = false)) })
	public TeacherTitleId getId() {
		return this.id;
	}

	public void setId(TeacherTitleId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TITLE_ID", nullable = false, insertable = false, updatable = false)
	public TechnicalTitle getTechnicalTitle() {
		return this.technicalTitle;
	}

	public void setTechnicalTitle(TechnicalTitle technicalTitle) {
		this.technicalTitle = technicalTitle;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TEACHER_ID", nullable = false, insertable = false, updatable = false)
	public Teacher getTeacher() {
		return this.teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DATE", length = 19)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

}
